#!/usr/bin/env python3
# -*- coding: utf-8 -*-

def fact(n):
	if(n == 1):
		return 1
	return n * fact(n - 1)
print('fact(1)=',fact(1))
print('fact(3)=',fact(3))
print('fact(15)=',fact(15))

def move(n,a,b,c):
	if n == 1:
		print('move',a,'--->',c)
	else:
		move(n-1,a,c,b)
		move(1,a,b,c)
		move(n-1,b,a,c)
move(2,'a','b','c')
print('----------')
move(3,'a','b','c')
print('----------')
move(4,'a','b','c')
print('----------')